<div id="mainside">
    <div id="page_nav" class="toolbar">
        <%= render :partial => '/admin/page_nav'%>&nbsp;|&nbsp;Articles
    </div>
    <table cellpadding="5px" cellspacing="0px" border="1px" bordercolor="#ddd" class="setting_table">
        <tr class="header">
            <%for column in @column_list %><%if column=='id' %>
            <th>
                ID
            </th>
            <%elsif column=='author' %>
            <th align="left" width="80px">
                Author
            </th>
            <%else %>
            <th align="left">
                <%=Article.columns_hash[column].human_name %>
            </th>
            <%end %><%end %>
            <th colspan="3">
                Operations
            </th>
        </tr>
        <%for article in @articles %>
        <tr class="<%= cycle('', 'alt') %>">
            <%for column in @column_list %><%if column=='id' %>
            <td width="30px">
                <%=h(article.id) %>
            </td>
            <%elsif column=='published_at' %>
            <td width="140px">
                <%=article.send(Article.columns_hash[column].name).strftime('%Y-%m-%d %H:%M:%S') %>
            </td>
            <%elsif column=='author' %>
            <td width="90px">
                <%=h(article.user.name.to_s) %>
            </td>
            <%else %>
            <td>
                <%=h(article.send(Article.columns_hash[column].name)) %>
            </td>
            <%end %><%end %>
            <td width="40px">
                <%=link_to 'Show', {:controller => '/articles', :action => 'show', :id => article}, {:class => 'command'} %>
            </td>
            <td width="40px">
                <%=link_to 'Edit', {:action => 'edit', :id => article}, :class => 'command' %>
            </td>
            <td width="40px">
                <%=link_to 'Destory', {:action => 'destory', :id => article}, :confirm => 'Are you sure?', :post => true, :class => 'command' %>
            </td>
        </tr>
        <%end %>
    </table>
    <div id="page_bottom_toolbar" class="toolbar">
        <%=link_to 'New Post', {:action => 'new'}, :class => 'command' %>
    </div>
	<%= render :partial => '/shared/paginator_bar' %>
</div>
<!-- /mainside -->
